#pragma once
#include <codec.h>

class audio_decoder : public ICodec
{
private:
    /* data */
public:
    audio_decoder(/* args */const char* codec_name,AVCodecParameters* codecpar);
    ~audio_decoder();
    int  decode(AVPacket* pkt,AVFrame* frame,int eof,int& got,int* finished) override;
    int  encode(const AVFrame*  frame, AVPacket* packet,int& got,int* finished) override;
    AVMediaType get_codec_type() const override;

private:
    AVCodec *m_dec = nullptr;
    AVCodecContext  *m_dec_ctx = nullptr;
    std::string m_codec_name;
    bool m_open_success = false;
};


